<%@ page language="java" import="com.bifrii.bo.*,com.bifrii.transferObjects.*,com.bifrii.dao.*,java.util.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<jsp:include page="/header.jsp" />

<div id="divPendingEventsTitle">Eventos no leídos</div>

<% 
	if(session.getAttribute("session.user") != null)
	{
		User currentUser = UsersManager.getInstance().getUser((Integer)session.getAttribute("session.user"));
		List<Event> pendingEvents = PendingEventManager.getInstance().getUnreadEvents(currentUser);
		
		if (pendingEvents.size() == 0)
		{
%>

<div id="divNoPendingEvents">No tiene eventos pendientes por leer</div>

<%		
		}
		else
		{
			for (Event event : pendingEvents)
			{
%>

<div class="box">
	<div class="title"><a href="FrontController?res=indexEvent.jsp&id=<%=event.getIdEvent()%>"><%=event.getName()%></a></div>
	<div class="description"><%=event.getDescription()%></div>
	<div class="info"></div>
</div>

<%
			}
		}
	}
	else
	{
		response.sendRedirect("index.jsp");
	}
%>

<jsp:include page="/footer.html" />
